#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py

import time


def timer(func):
    def wrapper(*args, **kwargs):
        start_time = time.time()
        f = func(*args, **kwargs)
        total_time = time.time() - start_time
        print("{} 耗时{}秒".format(func.__name__, total_time))
        return f
    return wrapper


@timer
def func_1():
    time.sleep(1)


if __name__ == '__main__':
    func_1()